//
//  TUIGroupSystemTipMessageCell.m
//  MarryBackEnd
//
//  Created by mac on 2020/10/12.
//  Copyright © 2020 WPP. All rights reserved.
//

#import "TUIGroupSystemTipMessageCell.h"

@implementation TUIGroupSystemTipMessageCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.container.backgroundColor = [UIColor whiteColor];
        self.container.layer.cornerRadius = 5;
        self.container.layer.masksToBounds = YES;
        
        //_contentLab = [[YYLabel alloc]init];
        //[self.container addSubview:_contentLab];
        //_contentLab.textAlignment = NSTextAlignmentLeft;
        //_contentLab.numberOfLines = 0;
        
        [self.container addSubview:self.coverImageView];
    }
    return self;
}
- (void)fillWithData:(TUIGroupSystemTipMessageCellData *)data {
    [super fillWithData:data];
    self.groupSystemTipData = data;
    //self.contentLab.attributedText = data.cutStr;
    self.nameLabel.hidden = YES;
    self.avatarView.hidden = YES;
    self.retryView.hidden = YES;
    [self.indicator stopAnimating];
    [self setNeedsLayout];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    [self.container setX:16];
    //self.contentLab.frame = self.groupSystemTipData.contentFrame;
    self.coverImageView.frame = self.container.bounds;
}
- (UIImageView *)coverImageView {
    if (!_coverImageView) {
        UIImageView *iv = [[UIImageView alloc]init];
        [self addSubview:iv];
        iv.image = [UIImage imageNamed:@"im_pic_tixing"];
        iv.contentMode = UIViewContentModeScaleAspectFit;
        iv.clipsToBounds = YES;
        _coverImageView = iv;
    }
    return _coverImageView;
}
@end
